package org.example.wx.user.service;

import org.example.wx.user.entity.ShippingAddress;

import java.util.List;
import java.util.Optional;

public interface ShippingAddressService {

    /**
     * 创建收货地址
     */
    ShippingAddress createAddress(Long userId, ShippingAddress address);

    /**
     * 更新收货地址
     */
    ShippingAddress updateAddress(Long userId, Long addressId, ShippingAddress address);

    /**
     * 删除收货地址
     */
    boolean deleteAddress(Long userId, Long addressId);

    /**
     * 根据ID查询地址详情
     */
    Optional<ShippingAddress> getAddressById(Long userId, Long addressId);

    /**
     * 查询用户的所有收货地址
     */
    List<ShippingAddress> getUserAddresses(Long userId);

    /**
     * 获取用户默认地址
     */
    Optional<ShippingAddress> getDefaultAddress(Long userId);

    /**
     * 设置默认地址
     */
    boolean setDefaultAddress(Long userId, Long addressId);

    /**
     * 验证地址是否属于用户
     */
    boolean validateAddressOwnership(Long userId, Long addressId);

    /**
     * 获取用户地址数量
     */
    long getUserAddressCount(Long userId);
}
